@import "global";
@import "../assets/iconfont/iconfont";

html, body {
  font-family: "Microsoft YaHei";
}

//status bar padding
body.g-body-md {
  //body{
  ion-content[marginTop] {
    margin-top: 24px;
  }
  .header-md {
    .toolbar-md {
      text-align: center;
      min-height: 64px;
      padding: 24px 4px 4px;
      .toolbar-title-md {
        font-size: 16px;
        font-weight: 700;
      }
    }
  }
}

.md ion-tab > .ion-page > ion-content.statusbar-padding:first-child .scroll-content {
  padding-top: 0;
}

.g-tabs {
  &.tabs-md {
    > .tabbar {
      @extend .g-border-top-1px;
      &:before {
        display: none;
      }
      .has-icon .tab-button-text {
        margin-top: 0;
      }
    }
  }
}

.toolbar {
  .toolbar-title {
    text-align: center;
  }
  .back-button-md {
    position: absolute;
    z-index: 999;
    margin: 0;
  }
}

.header-md {
  //border-bottom:1px solid $g-border-color;
  box-shadow: 0 1px 1px -1px $g-border-color;
  border: none;
  &:after {
    display: none;
  }
  .toolbar-background {
    &.toolbar-background-ios,
    &.toolbar-background-md {
      border: none;
    }
  }
  .bar-buttons-md[end] {
    position: absolute;
    right: 0;
  }
  &.no-border {
    box-shadow: none;
  }
  ion-navbar {
    .bar-button-md[icon-only] {
      padding: 0 10px;
      margin: 0;
    }
  }
}

//全局样式 g 为前缀

.g-content-light {
  background: #fff;
}

.g-footer-button {
  .footer-info {
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.2);
    span {
      color: #5EC2FF;
    }
  }
  &:before {
    display: none;
  }
  button {
    height: 60px;
    margin: 0;
    font-size: 18px;
    box-shadow: none;
  }
  &.danger {
    button {
      background: #FF6060;
      &.activated {
        background: #ee5c5c;
        box-shadow: none;
      }
    }
  }
  &.primary {
    button {
      background: #5EC2FF;
      &.activated {
        background: #5fb4ff;
        box-shadow: none;
      }
    }
  }
  &.small {
    button {
      border-radius: 10px;
      height: 50px;
      width: calc(100% - 56px);
      margin: 10px 28px 20px;
    }
  }
}

.bar-button {
  .iconfont {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 20px;
  }
}

.g-header-dark {
  .back-button-md, .toolbar-title {
    color: #fff;
  }
  .bar-buttons-md[end] {
    .bar-button {
      color: #fff;
    }
  }
}

.g-header-segment {
  .toolbar-md {
    padding: 0;
    .segment-md {
      width: 50%;
      .segment-button {
        height: 46px;
        line-height: 46px;
      }
    }
  }
}

.g-panel {
  margin-top: 20px;
  padding: 0 20px;
  background: #fff;
  box-shadow: $g-border-top-1px, $g-border-bottom-1px;
  &.no-padding {
    padding: 0;
  }
  ion-item {
    padding-left: 0;
    @extend .g-border-top-1px;
    &:first-child {
      box-shadow: none;
    }
    &.item.item-block {
      .item-inner {
        padding-right: 0;
        border-bottom: none;
        .label {
          width: 70px;
          padding-left: 20px;
          font-size: 14px;
          font-weight: 700;
          color: rgba(0, 0, 0, 0.8);
        }
        input {
          font-size: 14px;
        }
      }
      &.item-input-has-focus {
        .item-inner {
          box-shadow: none;
        }
      }
    }
    button[item-end] {
      margin: 0;
      height: 100%;
    }
  }
}

.g-button {
  box-shadow: none;
  border-radius: 10px;
  height: 60px;
  font-size: 15px;
  &.activated {
    box-shadow: none;
  }
  &.danger {
    background: #FF6060;
    &.activated {
      background: #ee5c5c;
      box-shadow: none;
    }
  }
  &.primary {
    background: #5EC2FF;
    &.activated {
      background: #5fb4ff;
      box-shadow: none;
    }
  }
  &.default {
    background: #FFFFFF;
    color: rgba(0, 0, 0, 0.4);
    @extend .g-border-1px;
    &.activated {
      background: #f4f4f4;
      @extend .g-border-1px;
    }
    .button-effect {
      background: #d0d0d0;
    }
  }
}

.g-input {
  width: calc(100% - 40px);
  height: 60px;
  margin: auto;
  background: #fff;
  @extend .g-border-1px;
  border-radius: 10px;
  input {
    margin: 0;
    height: 60px;
    text-align: center;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.4);
    width: 100%;
    &::placeholder {
      color: rgba(0, 0, 0, 0.4);
    }
  }
}

.margin-block {
  height: 20px;
}

[position-absolute] {
  position: absolute;
  z-index: 1;
}

[g-margin] {
  margin: 20px;
  width: calc(100% - 40px);
}

.toast-md .toast-wrapper {
  //width: 100px;
  width: fit-content;
  border-radius: 100px;
  text-align: center;
}

.item-md.item-input.ng-invalid.ng-touched:not(.input-has-focus):not(.item-input-has-focus) .item-inner {
  box-shadow: none;
}

.item-md.item-input.ng-valid.item-input-has-value:not(.input-has-focus):not(.item-input-has-focus) .item-inner, .item-md.item-input.ng-valid.input-has-value:not(.input-has-focus):not(.item-input-has-focus) .item-inner {
  box-shadow: none;
}

.segment-md .segment-button {
  color: rgba(0, 0, 0, 0.2);
  &.segment-activated {
    color: #FF6060;
  }
}

.hide {
  display: none;
}

.show {
  display: block;
}

.g-custom-header {
  position: absolute;
  top: 0;
  width: 100%;
  background: #fff;
  z-index: 10;
  font-size: 16px;
  text-align: center;
  height: 64px;
  line-height: 36px;
  padding: 24px 4px 4px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.8);
}

.loading-md {
  .loading-wrapper {
    background: #fff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
  }
}

ion-alert {
  .alert-wrapper {
    .alert-head {
      h2 {
        font-weight: 400;
      }
    }
    .alert-button:last-child {
      font-weight: 400;
    }
  }
}

.g-alert-custom{
  ion-backdrop{
    background: rgba(0,0,0,0.6);
  }
  .alert-wrapper{
    min-width: 240px;
    background-color: transparent;
    box-shadow: none;
  }
  .alert-head{
    background-color: #fff;
    padding-bottom: 40px;
    border-radius: 10px;
    &:before{
      content: '';
      height: 100px;
      width: 100px;
      display: block;
      margin: 30px auto;
      background: url("../assets/imgs/pic_laugh@3x.png");
      background-size: contain;
    }
    h2{
      margin-top: 0;
      font-size: 20px;
      color: map_get($text-colors,title);
    }
  }
  .alert-button-group{
    .alert-button{
      background: #FF5E70;
      border-radius: 10px;
      border: none;
      color: #fff;
      height: 52px;
    }
  }
}
.g-alert{
  .alert-button{
    color: map_get($text-colors,primary);
  }
  .g-alert-cancel{
    color: map_get($text-colors,info);
  }
}

.loading-md{
  .spinner-crescent circle{
    fill: transparent;
    stroke-width: 6px;
    stroke-dasharray: 120px;
    stroke-dashoffset: 0px;
    stroke: map_get($text-colors,primary)
  }
  .loading-wrapper{
    display: block;
    padding: 16px;
    .loading-spinner{
      text-align: center;
    }
    .loading-content{
      margin-top: 10px;
      margin-left: 0;
    }
  }
  &.transparent{
    ion-backdrop{
      background: transparent;
    }
  }
  &.not-full{
    top: unset;
    height: calc(100% - 66px);
  }
}

.g-popover-bottom {
  &.transparent{
    ion-backdrop {
      background: transparent;
    }
  }
  ion-backdrop {
    opacity: 0.1;
  }
  .popover-viewport,.popover-wrapper {
    opacity: 1;
  }
  .popover-content {
    width: 100%;
    margin-left: -2px;
    //margin-bottom: -12px;
    //margin-bottom: -2%;
    background: #ffffff;
    box-shadow: $g-border-top-1px;
  }
}

.g-infinite-scroll{
  .infinite-loading-spinner{
    display: inline-block;
    vertical-align: middle;
  }
  .infinite-loading-text{
    display: inline-block;
    vertical-align: middle;
    margin: 0 0 0 20px;
    font-size: 14px;
  }
}
.g-no-more{
  text-align: center;
  margin-bottom: 20px;
  font-size: 14px;
  color: map_get($text-colors,info);
}

